package master

type User struct {
	AllowedKeys  []string `json:"allowedKeys"`
	Type         string   `json:"type"`
	AllowedPorts *[]int   `json:"allowedPorts"`
}

type SshServer struct {
	Port  int             `json:"port"`
	Users map[string]User `json:"users"`
}

type Ssh struct {
	PrivateKey string     `json:"privateKey"`
	PublicKey  string     `json:"publicKey"`
	Server     *SshServer `json:"server"`
}

type ForwardFrom struct {
	Ip   string `json:"ip"`
	Port int    `json:"port"`
}

type ForwardToHost struct {
	Ips  []string `json:"ips"`
	Port int      `json:"port"`
}

type ForwardTo struct {
	Host ForwardToHost `json:"host"`
	Port int           `json:"port"`
}

type Forward struct {
	From ForwardFrom `json:"from"`
	To   ForwardTo   `json:"to"`
}

type Script struct {
	Script string `json:"script"`
}

type EnvValue struct {
	Type   string  `json:"type"`
	Custom *string `json:"custom"`
}

type Crontab struct {
	Cron   string              `json:"cron"`
	Script string              `json:"script"`
	Envs   map[string]EnvValue `json:"envs"`
}

type Config struct {
	Ssh      *Ssh               `json:"ssh"`
	Forwards map[string]Forward `json:"forwards"`
	Scripts  map[string]Script  `json:"scripts"`
	Envs     map[string]string  `json:"envs"`
	Crontabs map[string]Crontab `json:"crontabs"`
}
